// oled display hooked up to transistor on power pin to allow atmega to control it directly
// reset to digital pin
// requires NewSoftSerial 11 beta or newer

// this demo will power up, play random boxes for 10 seconds, and then power down

#include <G4D.h>
#include <SoftwareSerial.h>

#define POWER_PIN      8
#define RESET_PIN      9
#define SOFT_TX        2
#define SOFT_RX        3

SoftwareSerial oledSerial(SOFT_RX, SOFT_TX);
G4D display(POWER_PIN,RESET_PIN,&oledSerial);

void setup(void)
{  
	oledSerial.begin(57600);

	display.powerUp();

	unsigned long timeout;
	timeout = millis() + 10000;
	while (millis() <= timeout) {
		display.rectangle(random(128),random(128),random(128),random(128),random(255),random(255),random(255));
	}

	display.powerDown();

}
void loop(void){    
}
